package com.xsq.wifi;

import android.app.Application;
import android.content.Context;
import android.os.StrictMode;

import androidx.multidex.MultiDex;

import com.orhanobut.hawk.Hawk;
import com.orhanobut.hawk.NoEncryption;

/**
 * 编写人：李振德
 * 创建时间：2025/05/07
 */
public class MyApplication extends Application {

    private static MyApplication _context;

    @Override
    protected void attachBaseContext(Context context) {
        super.attachBaseContext(context);
        MultiDex.install(this);
    }

    @Override
    public void onCreate() {
        super.onCreate();
        StrictMode.VmPolicy.Builder builderx = new StrictMode.VmPolicy.Builder();
        StrictMode.setVmPolicy(builderx.build());
        builderx.detectFileUriExposure();
        Hawk.init(this).setEncryption(new NoEncryption()).build();
        _context = this;
    }

    public static MyApplication GetIntanse() {
        if (_context == null) {
            _context = new MyApplication();
        }
        return _context;
    }
    public static void setContext(MyApplication context) {
        _context = context;
    }

    public static MyApplication getContext() {
        return _context;
    }
}
